package api

import (
	"bbs-go/internal/services"

	"github.com/kataras/iris/v12"
	"github.com/mlogclub/simple/web"
	"github.com/mlogclub/simple/web/params"
)

type IndexCategoryController struct {
	Ctx iris.Context
}

func (c *IndexCategoryController) AnyList() *web.JsonResult {
	list, paging := services.IndexCategoryService.FindPageByParams(params.NewQueryParams(c.Ctx).LikeByReq("name").EqByReq("status").PageByReq().Asc("sort"))
	return web.JsonData(&web.PageResult{Results: list, Page: paging})
}
